import ca.uhn.hl7v2.HL7Exception;
import com.hinacom.pix.client.PIXSource;
import com.hinacom.pix.entity.AssigningAuthority;
import com.hinacom.pix.entity.Patient;
import com.hinacom.pix.entity.PatientIdentifier;
import com.hinacom.pix.entity.PatientName;
import org.junit.Test;

import java.io.IOException;
import java.text.ParseException;

/**
 * Created by Administrator on 2017/1/16.
 */
public class T722 {
    @Test
    public void t10() throws ParseException, HL7Exception, IOException {
        String assigningAuthorityPid = "1.2.156.10011.20170115.1021";

        Patient patient = new Patient();
        PatientIdentifier patientIdentifier = new PatientIdentifier();
        patientIdentifier.setId(assigningAuthorityPid);
        AssigningAuthority assigningAuthority = AssigningAuthority.createInstanceWithDefualtDomain();

        patientIdentifier.setAssigningAuthority(assigningAuthority);
        patient.setInternalIdentifier(patientIdentifier);
        PatientName patientName = new PatientName();
        patientName.setLastName("Maria");
        patientName.setFirstName("Hinacom");

        patient.setPatientName(patientName);

        PIXSource pixSource = new PIXSource();
        pixSource.registerInPatient(patient);
    }
}
